import axios from "/@/utils/http/axios";
import {MethodEnum} from "/@/utils/http/axios/enum/method-enum";
import {PageModel} from "/@/api/system/model/CommonModel";
import {VacationModel, VacationQueryModel} from "/@/api/demo/model/VacationModel";

/**
 * 分页查询请假信息列表
 * @param isHint
 * @param callBack
 */
export function listVacationPage(data: VacationQueryModel,callBack?: Function):Promise<PageModel<VacationModel[]>> {
    return axios.httpRequest("/demo/vacation/listVacationPage", MethodEnum.GET, data, {callBack});
}


/**
 * 新增请假信息
 * @param callBack
 */
export function insertVacation(data: VacationModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/demo/vacation/insertVacation", MethodEnum.POST, data, {callBack});
}

/**
 * 修改请假信息
 * @param callBack
 */
export function updateVacation(data: VacationModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/demo/vacation/updateVacation", MethodEnum.POST, data, {callBack});
}

/**
 * 发起请假流程
 * @param data
 * @param callBack
 */
export function startVacationFlow(data: VacationModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/demo/vacation/startVacationFlow", MethodEnum.POST, data, {callBack});
}

/**
 * 请假流程处理
 * @param data
 * @param callBack
 */
export function vacationFlowDispose(data: VacationModel,callBack?: Function):Promise<void> {
    return axios.httpRequest("/demo/vacation/vacationFlowDispose", MethodEnum.POST, data, {callBack});
}
/**
 * 根据请假信息id删除请假信息
 * @param data
 * @param callBack
 */
export function deleteVacationByVacationId(vacationId: string,callBack?: Function):Promise<void> {
    return axios.httpRequest("/demo/vacation/deleteVacationByVacationId", MethodEnum.GET, {vacationId}, {callBack});
}

/**
 * 根据请假信息id查询请假信息
 * @param vacationId
 * @param callBack
 */
export function selectVacationByVacationId(vacationId: string,callBack?: Function):Promise<VacationModel> {
    return axios.httpRequest("/demo/vacation/selectVacationByVacationId", MethodEnum.GET, {vacationId}, {callBack});
}
